<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page isELIgnored="false" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<%@ include file="/common/common-jsp.jspf" %>
		<title>添加员工</title>
		<link rel="stylesheet" type="text/css" href="${rootpath }/css/employee/add.css">
		<%-- <script type="text/javascript" src="${rootpath }/js/page.js"></script> --%>
		<script>
			window.onload = function() {
				if(null) {
					alert(123);
				}

			};
		</script>
	</head>
	<body>
		<div id="employee-add">
			<form:form action="${rootpath}/employee/emp" modelAttribute="employee" method="post">
				<label>姓名:<form:input path="name"></form:input></label>
				<form:errors path="name"></form:errors>
				<br>
				<%-- genders: 一个 map, map-key 作为 radio 的值, map-value 作为 radio 的标签 --%>
				<%-- 比如 genders.put(1, "男"); --%>
				<label>性别:<form:radiobuttons path="gender" items="${genders}"></form:radiobuttons>
				</label>
				<form:errors path="gender"></form:errors>
				<br>
				<%-- 需要:  --%>
				<%-- 1. 在 Employee 的 birthday 属性上添加 @DateTimeFormat(pattern = "yyyy-MM-dd") --%>
				<label>生日:<form:input path="birthday"></form:input></label>
				<form:errors path="birthday"></form:errors>
				<br>
				<label>部门:<form:select path="department.id" 
						items="${departments}" itemLabel="name" 
						itemValue="id"></form:select>
				</label>
				<br>
				<input type="submit" value="Submit">
				<br>
			</form:form>
		</div>
	</body>
</html>
